//
//  SceneManager.m
//  jumpingfrog
//
//  Created by Tri Vo on 8/24/13.
//  Copyright (c) 2013 Tri Vo. All rights reserved.
//

#import "SceneManager.h"
#import "MenuScene.h"
#import "SettingsScene.h"
#import "AboutScene.h"
#import "GuideScene.h"
#import "ChooseLevelScene.h"
#import "GamePlayScene.h"

static SceneManager *instance = nil;

@implementation SceneManager

+ (id)getInstance {
    if (instance == nil) {
        instance = [[SceneManager alloc] init];
    }
    return instance;
}

+ (void)destroyInstance {
    [instance release];
    instance = nil;
}

- (id)init {
    if (self = [super init]) {
        m_currentScene = nil;
    }
    return self;
}

- (void)goAbout {
    [GameController replaceScene:[AboutScene scene]];
    m_currentScene = S_ABOUT;
}

- (void)goGuide {
    [GameController replaceScene:[GuideScene scene]];
    m_currentScene = S_GUIDE;

}

- (void)goMenu {
    [GameController replaceScene:[MenuScene scene]];
    m_currentScene = S_MENU;
}

- (void)goPlay {
    [GameController replaceScene:[GamePlayScene scene]];
    m_currentScene = S_PLAY;
}

- (void)goSettings {
    [GameController replaceScene:[SettingsScene scene]];
    m_currentScene = S_SETTINGS;
}

- (void)goChooseLevel {
    [GameController replaceScene:[ChooseLevelScene scene]];
    m_currentScene = S_CHOOSELEVEL;
}

@end
